package lucene.server.cdc.mysql.model;

import lombok.Data;

import java.io.Serializable;

@Data
public class BinlogPosition implements Serializable {
    /**
     * binlog文件的名字
     */
    private String binlogName;
    /**
     * binlog文件的位置
     */
    private Long position;
    /**
     * binlog的服务id
     */

    public BinlogPosition(String binlogName, Long position){
        this.binlogName = binlogName;
        this.position = position;
        if (this.position == null || this.position < 4L ){
            this.position = 4L;
        }
    }
    public Long getPosition() {
        if (position == null || position < 4L ){
            return 4L;
        }else {
            return position;
        }
    }
}


